using System.Collections.Generic;
using UnityEngine;

public class UI_ItemSlotParent : MonoBehaviour
{
    private UI_ItemSlot[] itemSlots;

    public void UpdateSlot(List<Inventory_Item> items)
    {
        itemSlots ??= GetComponentsInChildren<UI_ItemSlot>();

        for (int i = 0; i < itemSlots.Length; i++)
        {
            if (i < items.Count)
                itemSlots[i].UpdateItemSlot(items[i]);
            else
                itemSlots[i].UpdateItemSlot(null);
        }
    }    
}
